<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="../../js/new-ajax.js"></script>
<!-- <script type="text/javascript" src="../../js/admin-poweritem.js"></script> -->
<title></title>
<style type="text/css">
body{
	background: #ccc;
	margin: 0px;
	font-size: 12px;
}
div.menu-container{
	padding: 5px 3px;
	background: #fff;
	margin: 3px;
}
div.menu-header{
	padding: 8px 0px;
	text-align: center;
	background: #FA6703;
	color: #fff;
	font-weight: bold;
	cursor: default;
}
#menuContainer{
	cursor: default; 
}
#menuContainer div{
	padding: 1px 0px;
}
</style>
<script type="text/javascript">
var menuItems=[
   	{id:1,url:"",text:"系统信息配置",pid:0},
   	{id:2,url:"self-admin.jsp",text:"站点信息配置",pid:1},
   	{id:3,url:"midify-password.jsp",text:"密码修改",pid:1},
   	{id:4,url:"login-out.jsp",text:"注销",pid:1},
   	{id:5,url:"",text:"帐号管理",pid:0},
   	{id:6,url:"admin_account_list",text:"帐号列表",pid:5},
   	{id:7,url:"pages/accounts-edit.jsp",text:"录入帐号",pid:5},
   	{id:8,url:"",text:"采购单位管理",pid:0},
   	{id:9,url:"gov-list-adjust.jsp",text:"采购单位资料审核",pid:8},
   	{id:10,url:"gov-list.jsp",text:"采购单位列表",pid:8},
   	{id:11,url:"",text:"供应商管理",pid:0},
   	{id:12,url:"business-list-adjust.jsp",text:"供应商资料审核",pid:11},
   	{id:13,url:"business-list.jsp",text:"供应商列表",pid:11},
   	{id:14,url:"",text:"市场动态管理",pid:0},
   	{id:15,url:"market-news-list.jsp",text:"动态列表",pid:14},
   	{id:16,url:"",text:"企业类型管理",pid:0},
   	{id:51,url:"market-news-edit.jsp",text:"录入动态",pid:14},
   	{id:17,url:"",text:"政策法规管理",pid:0},
   	{id:18,url:"lay-news-list.jsp",text:"法规列表",pid:17},
   	{id:19,url:"lay-news-edit.jsp",text:"录入法规",pid:17},
   	{id:20,url:"",text:"采购指南管理",pid:0},
   	{id:21,url:"shopping-news-list.jsp",text:"指南列表",pid:20},
   	{id:22,url:"shopping-news-edit.jsp",text:"录入指南",pid:20},
   	{id:23,url:"",text:"友情连接管理",pid:0},
   	{id:24,url:"friend-link-list.jsp",text:"连接列表",pid:23},
   	{id:25,url:"friend-link-edit.jsp",text:"录入连接",pid:23},
   	{id:26,url:"",text:"地区管理",pid:0},
   	{id:27,url:"area-list.jsp",text:"地区列表",pid:26},
   	{id:28,url:"area-edit.jsp",text:"录入地区",pid:26},
   	{id:29,url:"",text:"行业管理",pid:0},
   	{id:30,url:"industry-list.jsp",text:"行业列表",pid:29},
   	{id:31,url:"industry-edit.jsp",text:"录入行业",pid:29},
   	{id:32,url:"",text:"产品分类管理",pid:0},
   	{id:33,url:"product-class-list.jsp",text:"分类列表",pid:32},
   	{id:34,url:"product-class-edit.jsp",text:"录入分类",pid:32},
   	{id:35,url:"",text:"反馈信息管理",pid:0},
   	{id:36,url:"feedback-business-list.jsp",text:"企业反馈",pid:35},
   	{id:37,url:"feedback-gov-list.jsp",text:"采购单位反馈",pid:35},
   	{id:38,url:"",text:"功能点管理",pid:0},
   	{id:39,url:"",text:"采购单位",pid:38},
   	{id:40,url:"power-item-list-gov.jsp",text:"功能点列表",pid:39},
   	{id:41,url:"power-item-edit-gov.jsp",text:"录入功能点",pid:39},
   	{id:42,url:"",text:"供应商",pid:38},
   	{id:43,url:"power-item-list-business.jsp",text:"功能点列表",pid:42},
   	{id:44,url:"power-item-edit-business.jsp",text:"录入功能点",pid:42},
   	{id:45,url:"",text:"角色管理",pid:0},
   	{id:46,url:"role-list.jsp",text:"角色列表",pid:45},
   	{id:47,url:"role-edit.jsp",text:"录入角色",pid:45},
   	{id:48,url:"",text:"综合管理后台",pid:38},
   	{id:49,url:"power-item-list-admin.jsp",text:"功能点列表",pid:48},
   	{id:50,url:"power-item-edit-admin.jsp",text:"录入功能点",pid:48},
   	{id:51,url:"business-type-list.jsp",text:"企业类型列表",pid:16},
   	{id:52,url:"business-type-edit.jsp",text:"录入类型",pid:16}
];
function loadPage(url){
	window.parent.document.getElementById("mainFrame").src=url;
}

function createMenuPanel(){
	createMenu(0);
}
function createMenu(pid,step){
	for(var i=0;i<menuItems.length;i++){
		if(menuItems[i].pid==pid){
			createMenuItem(menuItems[i],step?step:0);
			createMenu(menuItems[i].id,(step?step:0)+1);
		}
	}
}
function createMenuItem(menuItem,step){
	var menuContainer=dqbb.$("menuContainer");
	var div=document.createElement("div");
	if(menuItem.url.trim().length<1){//没有地址
		div.innerHTML="<b>"+stepToSpace(step)+menuItem.text+"</b>";
	}
	else{
		div.innerHTML=stepToSpace(step)+menuItem.text;
		div.url=menuItem.url;
		div.onclick=function(){
			if(window.currentMenu){
				window.currentMenu.style.backgroundColor="";
			}
			window.currentMenu=this;
			this.style.backgroundColor="#ccc";
			alert(menuItem.url);
			loadPage(this.url);
		};
		div.onmouseover=function(){
			this.style.backgroundColor="#ccc";
		};
		div.onmouseout=function(){
			if(this!=window.currentMenu){
				this.style.backgroundColor="";
			}
		};
	}
	menuContainer.appendChild(div);
}
function stepToSpace(step){
	var buffer="";
	for(var i=0;i<step;i++){
		buffer+="&nbsp;&nbsp;&nbsp;&nbsp;";
	}
	return buffer;
}
window.onload=function(){
	createMenuPanel();
};
</script>
</head>
<body>
<div class="menu-container">
	<div class="menu-header">系统菜单</div>
	<div id="menuContainer">
		
	</div>
</div>
</body>
</html>